<!-- views/generalview/components/card-three.vue -->
<template>
  <a-spin style="width: 100%">
    <a-card :bordered="false" style="height: 150px">
      <a-statistic style="margin-left: 10px" title="累计发电量" :value="renderData" animation :precision="2">
        <template #suffix>{{ 'GWh' }}</template>
      </a-statistic>
    </a-card>
  </a-spin>
</template>

<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { getTotalPower } from '../../../apis/home-pv'

const renderData = ref<any>(0)

const getData = async () => {
  const res = await getTotalPower()
  if (res.data.code == 200) {
    renderData.value = res.data.data.singleInfo.singleValue
  }
}

onMounted(async () => {
  await getData()
})
</script>